hose

timed_float TPT.hose(timed_float expr, timed_float ref, timed_float xtol, timed_float ytol, [int options])

This function generates bounds around the time dependent expression ref(t) and checks if the expression expr(t) is encapsulated within these bounds. The hose consists of all the rectangles with the size xtol (time tolerance) and ytol (value tolerance) around every sample point of the reference ref(t).

The result for a time t is the smallest delta between expr(t) and the hose around ref(t). When the signal expr(t) is covered by the hose, the result is 0.0, otherwise the smallest (signed) delta between expr(t) and the reference hose ref(t) will be returned.
If all of the involved values are NaN, the result is 0.0. If some but not all of the involved values are NaN, the result is {@link #DEVIATION_TO_NAN}

The options parameter specifies the behavior of the hose function:

The figure below shows an example of the hose function: The red signal is expr(t) and the blue signal with dots is the reference signal ref(t). The hose function is built from rectangles depicted in gray. The hose function returns:

Parameters:

expr Timed float expression that shall be checked

ref Reference timed float expression defining the hose

xtol X tolerance (time tolerance) of hose. (For sampled systems xtol must be at least the step size to be relevant.)

ytol Y tolerance of hose

[options] (optional) option settings. Can be one of (or a bit-or combination of)

TPT.HOSE_NORMAL,

TPT.HOSE_RELATIVE,

TPT.HOSE_IGNORE_TIME_BOUNDARIES, or

TPT.STRICT.


This parameter is optional. If omitted, the default is TPT.HOSE_NORMAL.

Returns:

Delta between the signal expr and the hose around ref

Examples:

   # hose function example
   signal = TPT.DoubleX(); 
   # original 
   ref = TPT.DoubleX();
   # reference signal
   res_ohne = TPT.DoubleX();
   res_mit = TPT.DoubleX();
   signal(t) := (t);
   during TPT.regexp([t>=0.5s]):
      ref(t) := signal(t-0.1);
      # without ignore time boundaries option
      res_ohne(t) := TPT.hose(signal(t), ref(t), 0.11, 0); 
      # with ignore time boundaries option
      res_mit(t) := TPT.hose(signal(t), ref(t), 0.11, 0, TPT.HOSE_IGNORE_TIME_BOUNDARIES);